<template>
	<!-- 修改虚假理赔 -->
	<view class="bigbox pb150">
		<view class="boxr bigbox mb40 pb30">
			<u-form :model="form" ref="uForm" label-width="200">
				<u-form-item label="姓名">
					<u-input v-model="form.name" input-align='right'/>
				</u-form-item>
				<u-form-item label="联系电话">
					<u-input v-model="form.iphone" input-align='right'/>
				</u-form-item>
				<u-form-item label="身份证号">
					<u-input v-model="form.id_number	" input-align='right' placeholder="请输入身份证号"/>
				</u-form-item>
				<u-form-item label="赔付事由" label-position="top">
					<u-input v-model="form.remark" 
					type="textarea" 
					placeholder="请输入你的赔付事由（不超过500字)" 
					height='350'
					:custom-style='customStyle'/>
				</u-form-item>
				<u-form-item label="赔付金额">
					<u-input v-model="form.price" input-align='right' placeholder="请输入赔付金额"/>
				</u-form-item>
				<u-form-item label="相关资料" label-position="top" :border-bottom='false'>
					<image :src="img" class="w340 h240"  @tap="upload()"></image>
				</u-form-item>
			</u-form>
			
		</view>
		<view class="mr56 h86 paybtn" @tap="submit()">
			提交
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					name: '',
					iphone: '',
					id_number: '',
					remark:'',
					price:'',
					image:''
				},
				//输入框的样式
				customStyle:{
					background: '#F5F8FB',
					borderRadius: '6rpx',
					paddingTop:'30rpx',
					paddingLeft:'30rpx',
					border:'2rpx solid #D2DEEB',
				},
				img:'/static/img/my/6jianli-photo.png'
			};
		},
		onNavigationBarButtonTap(e) {
		    uni.navigateTo({
		        url: `/pages/my/customerService/falseCompensate/historicalClaims/historicalClaims`
		    })
		},
		methods:{
			upload(){
				this.$tool.upload().then(res => {
					this.form.image = res.data.url;
					this.img = res.data.fullurl;
				})
			},
			submit(){
				this.$api.settlementOfClaims(this.form).then(res => {
					this.$u.toast(res.msg);
					if (res.code == 1) {
						setTimeout(() => {
							uni.navigateBack()
						}, 1000)
					}
				})
			}
		}

	}
</script>

<style lang="scss">
.paybtn {
		width: 100%;
		margin: 0 auto;
		text-align: center;
		line-height: 86rpx;
		background: #1385FF;
		border-radius: 10rpx;
		color: #FFFFFF;
		z-index: 99;
	}
</style>
